from sqlobject import *

__all__ = ['Temperature', 'ShortwaveRadiation', 'Precipitation', 'UWind',
           'VWind', 'WindSpeed', 'WindDirection', 'AirTemperature',
           'RelativeHumidity', 'Salinity', 'Density', 'IsothermDepth', 'Sample']


class Sample(SQLObject):
    datetime = DateTimeCol() 
    latitude = FloatCol()
    longitude = FloatCol()
    
    depth = FloatCol()
    temperature = FloatCol(default=None)
    shortwaveradiation = FloatCol(default=None)
    precipitation = FloatCol(default=None)
    uwind = FloatCol(default=None)
    vwind = FloatCol(default=None)
    windspeed = FloatCol(default=None)
    winddirection = FloatCol(default=None)
    airtemperature = FloatCol(default=None)
    relativehumidity = FloatCol(default=None)
    salinity = FloatCol(default=None)
    density = FloatCol(default=None)


class Temperature(SQLObject):
    datetime = DateTimeCol() 
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)


class ShortwaveRadiation(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    sd = FloatCol()
    max = FloatCol()
    quality = IntCol()
    source = IntCol()
    buoy = StringCol(length=6)


class Precipitation(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    sd = FloatCol()
    fraction = FloatCol()
    quality = IntCol()
    source = IntCol()
    buoy = StringCol(length=6)


class UWind(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    buoy = StringCol(length=6)


class VWind(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    buoy = StringCol(length=6)


class WindSpeed(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)


class WindDirection(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)


class AirTemperature(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)


class RelativeHumidity(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)


class Salinity(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    source = IntCol()
    buoy = StringCol(length=6)


class Density(SQLObject):
    datetime = DateTimeCol()
    depth = FloatCol()
    value = FloatCol()
    quality = IntCol()
    source = IntCol()
    buoy = StringCol(length=6)


class IsothermDepth(SQLObject):
    datetime = DateTimeCol()
    value = FloatCol()
    quality = IntCol()
    buoy = StringCol(length=6)

